(function($f) {	$f.extend.feature("myFeature1", "myPlugin1", "4c66b938-5b8f-4a61-b76d-498d107f15ce", function(self) {

	"use strict";
	
	// feature info
	this.featureInfo = {
		title: "My Feature 1",
		version: "0.0.1" // major.minor.build
	};

	// pre-initialization handler
	// called just after feature instance is created any any merging or includes are processed
	// Note: Since 'self' carries plugin reference, to use feature instance reference, use 'this'
	// returns (boolean): true, if feature to be added, false otherwise
	this.onFeaturePreInit = function() {
		// log
		$f.myPlugin1.lifeCycleElement().append("<p><b>featurePreInit:</b> " + this.featureInfo.title + " is instantiated for " + self.info.title + " plugin, and will be initialized.");

		return true;
	};
	
	// initialization handler
	// called when feature is initialized, however yet not merged
	// Note: Since 'self' carries plugin reference, to use feature instance reference, use 'this'
	// returns (boolean): true, if feature to be added, false otherwise
	this.onFeatureInit = function() {
		// log
		$f.myPlugin1.lifeCycleElement().append("<p><b>featureInit:</b> " + this.featureInfo.title + " is instantiated for " + self.info.title + " plugin, and is initialized.");

		return true;
	};
	
	this.hello = function() {
		if (isFunction(this.anotherFeatureWillComeHere.hello)) {
			this.anotherFeatureWillComeHere.hello();
		} else {
			$f.alert("Hello World! - I am feature 1 of " + self.info.title + ".");
		};
	};
	
	this.anotherFeatureWillComeHere = {
		// another feature will come here when merged into this feature
	};
	
	// note: same structure is defined as in host plugin, so this structure will
	// be merged at right place in host plugin
	this.showList = {
		// show features list in specified div
		ofFeatures: function() {
			// load features list
			var div = $("#featureslist");
			var list = "<table class='table table-bordered'><tr><th align='left'>Name</th><th align='left'>Id</th><th align='left'>Targets</th></tr>";
			$.each($f.all.featureDefinitions(), function(i, featureItem) {
				var className = ("myFeature1, myFeature2, myFeature3".indexOf(featureItem.name) !== -1 ? "info" : "");
				list += "<tr class='" + className + "'><td>" + featureItem.name + 
						"</td><td>" + featureItem.id + 
						"</td><td>" + featureItem.target + 
						"</td></tr>";
			});
			list += "</table>";
			div.empty().append(list);
		}
	};
}); }(fluid));
